Previous Book Contents Book Index Next

Inside Macintosh: Programming With the Text Encoding Conversion Manager /
Chapter 2 - Basic Text Types Reference / Basic Text Structures and Other Types
/


TECInfo

The converter information structure is used by the function TECGetInfo (page 55) to hold returned information about the Unicode Converter, the Text Encoding Converter, and Basic Text Types.

struct TECInfo {
   UInt16  format;
   UInt16  tecVersion;
   UInt32  tecTextConverterFeatures;
   UInt32  tecUnicodeConverterFeatures;
   UInt32  tecTextCommonFeatures;
   Str31   tecTextEncodingsFolderName;
   Str31   tecExtensionFileName;
};
typedef struct TECInfo TECInfo;
typedef TECInfo * TECInfoPtr;
typedef TECInfoPtr * TECInfoHandle;
enum {
   kTECInfoCurrentFormat = 1
};
enum {
   kTECKeepInfoFixBit = 0,
   kTECFallbackTextLengthFixBit = 1
   kTECTextRunBitClearFixBit = 2,
   kTECTextToUnicodeScanFixBit = 3,
   kTECAddForceASCIIChangesBit = 4,
   kTECPreferredEncodingFixBit = 5
};
enum {
   kTECKeepInfoFixMask = 1L << kTECKeepInfoFixBit,
   kTECFallbackTextLengthFixMask = 1L << kTECFallbackTextLengthFixBit
   kTECTextRunBitClearFixMask = 1L << kTECTextRunBitClearFixBit,
   kTECTextToUnicodeScanFixMask = 1L << kTECTextToUnicodeScanFixBit,
   kTECAddForceASCIIChangesMask = 1L << kTECAddForceASCIIChangesBit,
   kTECPreferredEncodingFixMask = 1L << kTECPreferredEncodingFixBit
};
Field Description
format
The current format of the returned structure. The format of the structure is indicated by the kTECInfoCurrentFormat constant. Any future changes to the format will always be backward compatible; any new fields will be added to the end of the structure.
tecVersion
The current version of the Text Encoding Conversion Manager extension in BCD (binary coded decimal), with the first byte indicating the major version; for example, 0x0121 for 1.2.1.
tecTextConverterFeatures
New features or bug fixes in the Text Encoding Converter. No bits are currently defined.
tecUnicodeConverterFeatures
Bit flags indicating new features or bug fixes in the Unicode Converter. The bits currently defined are kTECKeepInfoFixBit, kTECFallbackTextLengthFixBit, kTECTextRunBitClearFixBit, and kTECTextToUnicodeScanFixBit, kTECAddForceASCIIChangesBit, and kTECPreferredEncodingFixBit; the corresponding masks are kTECKeepInfoFixMask, kTECFallbackTextLengthFixMask, kTECTextRunMaskClearFixMask, kTECTextToUnicodeScanFixMask, kTECAddForceASCIIChangesMask, and kTECPreferredEncodingFixMask.

The kTECKeepInfoFixBit is set if the Unicode Converter has a bug fix to stop ignoring certain control flags if the kUnicodeKeepInfoBit flag is set.

The kTECFallbackTextLengthFixBit is set if the Unicode Converter has a bug fix to use the source length (srcConvLen) and destination length (destConvLen) returned by a caller-supplied fall-back handler for any status it returns except kTECUnmappableElementErr. Previously it honored only these values if noErr was returned.

The kTECTextRunBitClearFixBitis set if ConvertFromUnicodeToTextRun and ConvertFromUnicodeToScriptCodeRun function correctly if the kUnicodeTextRunBit is clear.

The kTECTextToUnicodeScanFixBit is set if ConvertFromTextToUnicode is enhanced so mappings can depend on context and saved state. The consequences of this are (1) malformed input results in kTextMalformedInputErr; (2) ConvertFromTextToUnicode accepts the control flags kUnicodeLooseMappingsMask, kUnicodeKeepInfoMask, and kUnicodeStringUnterminatedMask; (3) elimination of redundant direction overrides when converting Mas OS Arabic and Hebrew to Unicode; and (4) improved mapping of 0x30-0x39 digits in Mac OS Arabic when loose mappings are used.
tecTextCommonFeatures
Bit flags indicating new features or bug fixes in Basic Text Types (the Text Common static library). No bits are currently defined.
tecTextEncodingsFolderName
A Pascal string with the (possibly localized) name of the Text Encodings folder.
tecExtensionFileName
A Pascal string with the (possibly localized) name of the Text Encoding Conversion Manager extension file.

kTECAddForceASCIIChangesBit is set if the new control flag bits kUnicodeForceASCIIRangeBit and kUnicodeNoHalfwidthCharsBit are supported for use with the functions ConvertFromTextToUnicode, ConvertFromUnicodeToText and so forth.

kTECPreferredEncodingFixBit is set to indicae that a preferred encoding is specified for CreateUnicodeToTextRunInfo and related functions, they handle it correctly even if it does not match the system script.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 NOV 1997